<style>
    #bc_city{
         -moz-appearance: none;background: rgba(0, 0, 0, 0) url("http://img2.isou365.cn/paimai/yunying/images/sanjiao.jpg") no-repeat scroll 130px 5px;border: 1px solid #d7d7d7;color: #666;float: left;
    font-family: "微软雅黑";font-size: 12px;height: 26px;line-height: 26px;margin: 0 10px 10px 0;text-align: left;width: 154px; margin-left:10px; 
    }
</style>
<div class="yuList">
    <div class="yuSuo clearfix" style="float:left;">
        <form id="searchFrom">
            <if condition="$params.status eq 3">
                <input type="text" id="start_time" name="start_time" class="completion_time_start" readonly placeholder="过户完成时间" value="{$params.start_time}" >
                <input type="text" id="end_time" name="end_time" class="completion_time_start" readonly placeholder="过户完成时间" value="{$params.end_time}" >
            </if>
            <select name="bc_city" id="bc_city">
                 <option value="0">请选择所在地</option>
                <?php foreach ($bc_city as $k => $v): ?>
                    <option value="{$k}">{$v}</option>
                <?php endforeach ?>
            </select>
            <script>$("#bc_city").val("<?php echo is_array($params['bc_city'])? 0 : $params['bc_city']  ;?>");</script>

            <input  id="order_type" name="order_type" type="hidden" value="{$params.order_type}"/>
            <input  id="status" name="status" type="hidden" value="{$params.status}"/>
            <input class="suoDian " name="contact_person" type="text" value="{$params.contact_person}" placeholder="车商联系人" />
            <input class="suoDian " name="contact_mobile" type="text" value="{$params.contact_mobile}" placeholder="联系人电话" />
            <input class="suoDian " name="order_no" type="text" value="{$params.order_no}" placeholder="拍卖单号" />
            <input class="suoDian " placeholder="车牌号" type="text" name="car_plate_number" value="{$params.car_plate_number}" <?php echo $params['status']==3 ? 'style=" clear: left;"' : '' ;?>>
            <input type="button" onclick="search();" value="搜索" class="suoSou" style="width:80px;">
        </form>
        <if condition="$params['order_type'] eq 'p_order'">
            <input type="button" name="switch_order" onclick="switch_order(this)" style="background: #20ab4f" value="切换到订单管理" class="switch-single">
        <else/>
            <input type="button" name="switch_order" onclick="switch_order(this)" value="切换到拍单管理" style="background: #f99d0c" class="switch-single">
        </if>
    </div>
    <table class="table table-bordered">
        <thead>
            <tr>
                <th>拍卖单号</th>
                <th>车型</th>
                <th>所在地</th>
                <th>车牌号</th>
                <th>车商联系人</th>
                <th>联系人电话</th>
                <?php if ($params['status']==1): ?>
                    <th>过户限制</th>
                    <th>渠道来源</th>
                <?php endif ?>
                <?php if ($params['status']==2): ?>
                    <th>过户截止时间</th>
                    <th>车辆落户</th>
                    <th>操作人</th>
                <?php endif ?>
                <?php if ($params['status']==5): ?>
                    <th>车辆落户</th>
                    <th>预计提档时间</th>
                    <th>操作人</th>
                <?php endif ?>
                <?php if ($params['status']==3): ?>
                    <th>车辆落户</th>
                    <th>过户成功时间</th>
                    <th>操作人</th>
                <?php endif ?>
                <?php if ($params['status']==4): ?>
                    <th>车辆落户</th>
                    <th>过户失败时间</th>
                    <th>操作人</th>
                <?php endif ?>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>    
        <volist name="list" id="vo" key="k">
            <tr>
                <td>{$vo.order_no}</td>
                <td><a href="/Car/reportWithCert/car_id/{$vo.car_id}" target="_blank">{$vo.model}</a></td>
                <td>{$vo.bc_city_name}</td>
                <td>{$vo.plate_number}</td>
                <td>{$vo.contact_person}</td>
                <td>{$vo.contact_mobile}</td>
                <?php if ($params['status']== 1): ?>
                <td>{$vo.transfer_limit}</td>
                <td>
                    <if condition="$vo.comefrom neq ''">
                      <?php if(empty($vo['comefrom_url'])):?>
                        <?php echo $show_from[$vo['comefrom']];?>
                      <?php else: ?>
                        <a href="{$vo.comefrom_url}" target="_blank" rel="noreferrer"><?php echo $show_from[$vo['comefrom']];?></a>
                      <?php endif;?>
                    </if>
                </td>
                <td>
                <?php if($params['order_type'] == 'p_order'): ?>
                    <?php if (!$vo['is_lock']): ?>
                        <a href="/CarTransfer/startTransfer?id={$vo.transfer_id}&order_type=p_order">开始过户</a>
                          <?php if ($vo['is_again_void']): ?>
                            <a href="javascript:" onclick="violate({$vo.transfer_id})">违约</a>
                        <?php endif ?>
                        <?php if ($vo['is_show_dispute']): ?>
                            <!-- <a href="javascript:" onclick="confirm_vialate({$vo.order_id})">争议</a> -->
                            <a href="/CarTransfer/dispute/transfer_id/{$vo.transfer_id}" target="_blank">争议</a>
                        <?php endif ?>
                    <?php else: ?>
                        <a href="javascript:" class="ash-grey">开始过户</a>
                    <?php endif ?>
                <?php else:?> <!--如果是订单，那么始终显示开始过户-->
                    <a href="/CarTransfer/startTransfer?id={$vo.transfer_id}&order_type=d_order">开始过户</a>
                <?php endif ?>
                </td>
                <?php endif ?>
                <?php if ($params['status']==2): ?>
                    <td>
                    <?php if ((strtotime($vo['deadlinetime']) - strtotime(date('Y-m-d H:i:s'))) < 28800): ?>
                        <span style='color:red;'>{$vo.deadlinetime}</span>
                    <?php elseif ((strtotime($vo['deadlinetime']) - strtotime(date('Y-m-d H:i:s'))) >= 28800 && (strtotime($vo['deadlinetime']) - strtotime(date('Y-m-d H:i:s'))) <= 115200 ): ?>
                        <span style='color:orange;'>{$vo.deadlinetime}</span>
                    <?php else: ?>
                        <span>{$vo.deadlinetime}</span>
                    <?php endif ?>

                    </td>
                    <td>{$vo.transfer_to_name}</td>
                    <td>{$vo.emp_name}</td>
                    <td>
                    <?php if($params['order_type'] == 'p_order'): ?>
                        <?php if (!$vo['is_lock']): ?>
                            <a href="/CarTransfer/transfering?id={$vo.transfer_id}&order_type=p_order">过户</a>
                            <?php if ($vo['is_again_void']): ?>
                            <a href="javascript:" onclick="violate({$vo.transfer_id})">违约</a>
                            <?php endif ?>
                            <?php if ($vo['is_show_dispute']): ?>
                                <a href="/CarTransfer/dispute/transfer_id/{$vo.transfer_id}" target="_blank">争议</a>
                            <?php endif ?>
                        <?php else: ?>
                            <a href="javascript:" class="ash-grey">过户</a>
                        <?php endif;?>
                    <?php else:?> <!--如果是订单，就传递订单信息-->
                        <a href="/CarTransfer/transfering?id={$vo.transfer_id}&order_type=d_order">过户</a>
                    <?php endif ?>
                    </td>
                <?php endif ?>
                <?php if ($params['status']==5): ?>
                    <td>{$vo.transfer_to_name}</td>
                    <td>
                        <?php if ((strtotime($vo['mentiontime']) - strtotime(date('Y-m-d H:i:s'))) < 0): ?>
                            <span style='color:red;'>{$vo.mentiontime}</span>
                         <?php else: ?>
                        <span>{$vo.mentiontime}</span>
                    <?php endif ?>
                    </td>
                    <td>{$vo.emp_name}</td>
                    <td>
                        <?php if (!$vo['is_lock']): ?>
                            <a href="/CarTransfer/takeTransferFileView?id={$vo.transfer_id}">提档</a>
                        <?php else: ?> 
                            <a href="javascript:" class="ash-grey">提档</a>
                        <?php endif;?>
                    </td>
                <?php endif ?>
                <?php if ($params['status']==3): ?>
                    <td>{$vo.transfer_to_name}</td>
                    <td>{$vo.last_update}</td>
                    <td>{$vo.emp_name}</td>
                    <td>
                        <a href="/CarTransfer/viewTransfer/id/{$vo.transfer_id}" target="_blank">查看</a>
                    </td>
                <?php endif ?>
                <?php if ($params['status']==4): ?>
                    <td>{$vo.transfer_to_name}</td>
                    <td>{$vo.last_update}</td>
                    <td>{$vo.emp_name}</td>
                    <td>
                        <a href="/CarTransfer/viewTransfer/id/{$vo.transfer_id}" target="_blank">查看</a>
                    </td>
                <?php endif ?>

            

            </tr>
        </volist>
        </tbody>
    </table>    
    <div class="clearfix" ></div>
    <div class="pageFaye"><div class="pager">{$page}</div><div class="clear"></div></div>
</div>
<script>
$("#start_time").ymdateplugin({
    changeMonth: true,
    changeYear: true
});

$("#end_time").ymdateplugin({
    changeMonth: true,
    changeYear: true
});


</script>
<!--违约-->
<div class="chenggong1" id="violateDiv">
    <span class="paidan">您确定要置为违约吗?</span>
    <div class="shenhei-btn">
        <input type="hidden" name="violate_id"  value="" />
        <input type="button" value="确定" class="determine" id="vialate" />
        <input type="button" value="取消" class="cancel"  id="cancel1" />
    </div>
</div>

<div class="chenggong1" id="disputeinfo" style="height: 260px;">
    <span class="paidan"><h6>您确定将此车商置为争议吗 </h6></span>
    <textarea id="violate_remark" name="violate_remark" style="height:100px;width:430px;margin-top:20px;"></textarea>
    <em style="color:red;">&nbsp;*</em>
    <div class="shenhei-btn" style="margin-top:20px;">
    <input type="button" value="确定" class="determine" id="dispute" />
    <input type="button" value="取消" class="cancel" id="cancel2" onclick="colse_hide()"/>
    </div>
</div>

<div class="yunBei"></div>
<script>
    function violate(transfer_id){
        $('#violateDiv').css('display', 'block');
        $('.yunBei').css({'display':'block',"zIndex":999});
        $('input[name=violate_id]').val(transfer_id);
    }
    $("#vialate").on('click', function () {
        var transfer_id = $('input[name=violate_id]').val();
        var param = {
            'transfer_id':transfer_id
        };
        var btn_obj = $(this);
        btn_obj.val("提交中...").attr("disabled",'disabled');
        $.post('/carTransfer/violate', param, function (data) {
            if (data.code == '200') {
                btn_alert(data.msg);
                $('#violateDiv').fadeOut();
                btn_obj.val("确定").removeAttr("disabled style");
                setTimeout(function () {
                        window.location.reload();
                    }, 500);
            } else {
                shibai_alert(data.msg)
                btn_obj.val("确定").removeAttr("disabled style");
                $('#violateDiv').fadeOut();
            }
            $('.yunBei').css({'display':'none',"zIndex":999});
        }, 'json');
    });
    $("#cancel1").on('click', function () {
        $('#violateDiv').fadeOut();
        $('.yunBei').css({'display':'none',"zIndex":999});
    });
</script>